layui.use(['table','func','admin'], function(){
    var $ = layui.jquery;
    var table = layui.table;
    var laydate = layui.laydate;
    var form = layui.form;
    var func = layui.func;
    var admin = layui.admin;



    /**
     * 管理
     */
    var AssignmentTaskDetail = {
        tableId: "assignmentTaskDetail"
    };

    /**
     * 初始化表格的列
     */
    AssignmentTaskDetail.initColumn = function () {
        return [[
            {type: 'checkbox'},
            {field: 'id', hide: true, title: ''},
            {field: 'taskName', sort: true, title: '任务名称'},
            {field: 'userId', sort: true, title: '任务所属人'},
            {field: 'taskState', sort: true, title: '任务状态'},
            {field: 'taskBeginTime', sort: true, title: '开始日期'},
            {field: 'taskEndTime', sort: true, title: '截止日期'},
            {field: 'createTime', sort: true, title: '创建日期'},
            {field: 'updateTime', sort: true, title: '更新日期'},
        ]];
    };

// 渲染表格
    var tableResult = table.render({
        elem: '#' + AssignmentTaskDetail.tableId,
        url: '/task/userByTask?id=' + $("#userId").val(),
        page: false,
        height: "full-158",
        cellMinWidth: 100,
        cols: AssignmentTaskDetail.initColumn()
    });


    $('#cancel').click(function(){
        //关掉对话框
        admin.closeThisDialog();
    });


});